<div class="main row">
    <section class="content col-md-7 col-sm-7 col-xs-12 ">
        <?php
        if (isset($aLatestNews[0]) && count($aLatestNews) >= 20) {
            $parent_cate_url = "";
            if (isset($aLatestNews[0]->parent_cate_url) && $aLatestNews[0]->parent_cate_url != "")
                $parent_cate_url = $aLatestNews[0]->parent_cate_url . "/";
        ?>
        <article class="block-feature">
            <a class="thumbs" title="<?php echo $aLatestNews[0]->title; ?>" href="<?php echo $base_url . $parent_cate_url . $aLatestNews[0]->news_cate_url . "/" . $aLatestNews[0]->url . "-" . $aLatestNews[0]->news_id; ?>.html">
            <img src="<?php echo $img_url; ?>style/<?php echo $aLatestNews[0]->img_thumb; ?>" alt="<?php echo $aLatestNews[0]->title; ?>"></a>
            <h1>
            <a href="<?php echo $base_url . $parent_cate_url . $aLatestNews[0]->news_cate_url . "/" . $aLatestNews[0]->url . "-" . $aLatestNews[0]->news_id; ?>.html" title="<?php echo $aLatestNews[0]->title; ?>">
                <?php echo $aLatestNews[0]->title; ?></a>
        </h1>
            <p><?php echo $aLatestNews[0]->short_desc; ?></p>
        </article>
        <?php
        for ($i = 1; $i < 20; $i++) {
            $parent_cate_url = "";
            if (isset($aLatestNews[$i]->parent_cate_url) && $aLatestNews[$i]->parent_cate_url != "")
                $parent_cate_url = $aLatestNews[$i]->parent_cate_url . "/";
            ?>        
        <article class="block-article">
            <?php
            if (strpos(strtolower($aLatestNews[$i]->img_thumb2),'.jpg') !== false
                    || strpos(strtolower($aLatestNews[$i]->img_thumb2),'.jpeg') !== false
                    || strpos(strtolower($aLatestNews[$i]->img_thumb2),'.png') !== false){
            ?>            
            <a class="thumbs img_165_93" title="<?php echo $aLatestNews[$i]->title; ?>" href="<?php echo $base_url . $parent_cate_url . $aLatestNews[$i]->news_cate_url . "/" . $aLatestNews[$i]->url . "-" . $aLatestNews[$i]->news_id; ?>.html">
            <img src="<?php echo $img_url; ?>style/<?php echo $aLatestNews[$i]->img_thumb2; ?>" alt="<?php echo $aLatestNews[$i]->title; ?>"></a>
            <?php 
            }
            ?>
            <h3>						
            <a href="<?php echo $base_url . $parent_cate_url . $aLatestNews[$i]->news_cate_url . "/" . $aLatestNews[$i]->url . "-" . $aLatestNews[$i]->news_id; ?>.html" title="<?php echo $aLatestNews[$i]->title; ?>">
                <?php echo $aLatestNews[$i]->title; ?><span class="icon-photos"></span></a>
        </h3>
            <p><?php echo $aLatestNews[$i]->short_desc; ?></p>
        </article>
        <?php
            }
        }
        else { //nếu không đủ 7 tin thì show thông báo.
            ?>
            <div align='center' class='nodata'><?php echo $page_nodata; ?></div>
            <?php
        }
        ?>             
        </article>
    </section>
    <aside class="sidebar col-md-5 col-sm-5 col-xs-12 ">

        <div class="block-1 hide-480">
            <h2><a title="Đọc nhiều">Đọc nhiều</a></h2>
            <ul class="list-new list-read-more">
            <?php
                if (isset($aFeatureNews) && count($aFeatureNews) > 0) {
                    $parent_cate_url = "";
                    foreach ($aFeatureNews as $key => $item):
                        //Nếu tin có parent_cate_url thì mới attach vào.
                        if (isset($item->parent_cate_url) && $item->parent_cate_url != "")
                            $parent_cate_url = $item->parent_cate_url . "/";
                        ?>                 
                <li>
                    <a href="<?php echo $base_url . $parent_cate_url . $item->news_cate_url . "/" . $item->url . "-" . $item->news_id; ?>.html" title="<?php echo $item->title; ?>"><?php echo $item->title; ?></a>
                </li>
                <?php
                        $parent_cate_url = "";
                    endforeach;
                }
                else {
                ?>             
                    <li><?php echo $page_nodata; ?></li>
                    <?php
                }
                ?>
            </ul>
        </div>   
        <img src="<?php echo $img_url; ?>style/images/DHL_blackhawk.jpg">
        <span></span><span></span>
    </aside>
</div>

<div class="block-adv">
    <!--
    <div class="block-adv hide-480" style="text-align:center;height:92px;overflow:hidden;">
    </div>
    -->	
</div>

<div class="main row">
    <section class="content col-md-7 col-sm-7 col-xs-12 ">
        <div class="highlight   ">
            <h2 class="title clearfix">
                <a title="Văn bản pháp quy" href="<?php echo $base_url; ?>van-ban-phap-quy">
                    Văn bản pháp quy</a>
                <div class="dropdown dropdown-style pull-right">
                    <a id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="<?php echo $base_url; ?>#"></a>
                    <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                        <li><a href="<?php echo $base_url; ?>van-ban-moi">Văn bản mới</a></li>
                        <li><a href="<?php echo $base_url; ?>van-ban-vpcp">Văn bản VPCP</a></li>
                        <li><a href="<?php echo $base_url; ?>van-ban-chinh-phu">Văn bản chính phủ</a></li>
                        <li><a href="<?php echo $base_url; ?>van-ban-bo-tai-chinh">Văn bản Bộ tài chính</a></li>
                        <li><a href="<?php echo $base_url; ?>van-ban-cac-bo-nganh">Văn bản các bộ ngành</a></li>
                        <li><a href="<?php echo $base_url; ?>van-ban-tong-cuc-hai-quan">Văn bản Tổng cục Hải quan</a></li>
                        <li><a href="<?php echo $base_url; ?>van-ban-quoc-hoi">Văn bản quốc hội</a></li>                    
                    </ul>
                </div>
            </h2>
            <div class="row">
                <?php
                if ($aDocs != null && count($aDocs) > 0) {
                ?>
                <div class="block-left col-md-7">                    
                    <h3>
                        <a href="<?php echo $img_url."style/".$aDocs[0]->file; ?>" target="_blank" title="<?php echo $aDocs[0]->title; ?>">
                            <?php echo $aDocs[0]->title; ?></a>
                        <a href="<?php echo $img_url."style/".$aDocs[0]->file; ?>" target="_blank" style="float:right !important; color:#428bca; font-size:15px !important; font-weight:normal !important;"><img src="<?php echo $img_url; ?>style/images/Save-icon.png" style="width:32px !important;vertical-align:middle;margin-right:2px;margin-bottom:0">Tải về</a>
                    </h3>
                    <p>
                        <?php echo $aDocs[0]->desc; ?>
                    </p>
                </div>
                <?php
                }
                ?>
                <div class="block-right col-md-5">
                    <ul class="list-new">
                        <?php
                        for ($i = 1; $i < 4; $i++) {
                        ?>
                        <li>
                            <?php echo $aDocs[$i]->title; ?>
                            <a href="<?php echo $img_url."style/".$aDocs[$i]->file; ?>" target="_blank" style="float:right !important; color:#428bca; font-size:15px !important; font-weight:normal !important;"><img src="<?php echo $img_url; ?>style/images/Save-icon.png" style="width:32px !important;vertical-align:middle;margin-right:2px;margin-bottom:0">Tải về</a>
                        </li>                        
                        <?php 
                        }
                        ?>
                    </ul>
                </div>
            </div>
        </div>
    </section>  
</div>

<div class="main row">
    <section class="content col-md-7 col-sm-7 col-xs-12 ">
        <div class="highlight   ">
            <h2 class="title clearfix">
                <a title="Thủ tục hải quan" href="<?php echo $base_url; ?>thu-tuc-hai-quan">
                    Thủ tục hải quan</a>
                <?php
                $this->load->library('Mobile_Detect');
                $detect = new Mobile_Detect();
                if ($detect->isTablet()){
                ?>
                <div class="dropdown dropdown-style pull-right">
                    <a id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="#"></a>
                    <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">XNK thương mại</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Tạm nhập - tái xuất, tạm xuất - tái nhập</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Chuyển cảng, chuyển khẩu, trung chuyển, quá cảnh, đa phương thức</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Các thủ tục khác liên quan đến thông quan hàng hóa</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Phi mậu dịch, XNK biên giới, bưu chính, chuyển phát nhanh</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Khai báo, tham vấn, xác định trị giá</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Nộp thuế, bảo lãnh thuế và các thủ tục liên quan</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Miễn thuế, giảm thuế, hoàn thuế, xóa nợ</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Gia công cho thương nhân nước ngoài</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Đặt gia công ở nước ngoài</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Hàng SXXK, doanh nghiệp chế xuất</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Xăng dầu, khí và khí dầu mỏ hóa lỏng (LPG)</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Phát hành, sử dụng biên lai thu thuế, lệ phí hải quan</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Ô tô, xe máy</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Phương tiện vận tải khác</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Kho ngoại quan, kho bảo thuế, kho CFS</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Địa điểm kiểm tra, tập kết, làm thủ tục hải quan</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Cửa hàng miễn thuế</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Kiểm tra sau thông quan</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Doanh nghiệp ưu tiên</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Sở hữu trí tuệ</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Các thủ tục khác</a></li>                    
                    </ul>
                </div> 
                <?php
                }else{
                ?>    
                <div class="dropdown dropdown-style pull-right">
                    <a id="dLabel" role="button" data-toggle="dropdown" data-target="#" href="#"></a>
                    <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">XNK thương mại</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Tạm nhập - Tái xuất</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Chuyển cảng, chuyển khẩu</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Thông quan hàng hóa</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Phi mậu dịch</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Khai báo, tham vấn</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Nộp-bảo lãnh thuế</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Miễn-giảm-hoàn thuế</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Gia công</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Đặt gia công ở nước ngoài</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Hàng SXXK, chế xuất</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Xăng dầu, khí</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Phát hành, biên lai, lệ phí</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Ô tô, xe máy</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Phương tiện vận tải khác</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Kho ngoại quan, kho bảo thuế</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Thủ tục hải quan</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Cửa hàng miễn thuế</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Kiểm tra sau thông quan</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Doanh nghiệp ưu tiên</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Sở hữu trí tuệ</a></li>
                        <li><a href="<?php echo $base_url . "thu-tuc-hai-quan-group"; ?>">Các thủ tục khác</a></li>                    
                    </ul>
                </div> 
                <?php
                }
                ?>
            </h2>
            <div class="row">
                <?php
                if ($aCustoms != null && count($aCustoms) > 0) {
                ?>
                <div class="block-left col-md-7">                    
                    <h3>
                        <a href="/thu-tuc-hai-quan/<?php echo $aCustoms[0]->customs_url . '-' . $aCustoms[0]->customs_id; ?>">
                            <?php echo $aCustoms[0]->customs_name; ?></a>
                    </h3>
                    <p></p>
                </div>
                <?php
                }
                ?>
                <div class="block-right col-md-5">
                    <ul class="list-new">
                        <?php
                        for ($i = 1; $i < 4; $i++) {
                        ?>
                        <li>
                            <a href="/thu-tuc-hai-quan/<?php echo $aCustoms[$i]->customs_url . '-' . $aCustoms[$i]->customs_id; ?>">
                                <?php echo $aCustoms[$i]->customs_name; ?></a>
                        </li>                        
                        <?php 
                        }
                        ?>
                    </ul>
                </div>
            </div>
        </div>
    </section>  
</div>

<div class="main row">
    <section class="content col-md-7 col-sm-7 col-xs-12 ">
        <div class="highlight   ">
            <h2 class="title clearfix">
                <a title="Video" href="<?php echo $base_url; ?>video">Video</a>
                <div class="pull-right">
                    <a id="lnkMore" href="<?php echo $base_url; ?>video" class="btn-more">Xem thêm</a>
                </div>
            </h2>
            <ul class="list-media">
                <?php
                $i = 1;
                if ($aVideo != null && count($aVideo) > 0) {
                    foreach ($aVideo as $item) {
                ?>
                <li>    
                    <a onclick="thevid=document.getElementById('thevideo<?php echo $i;?>'); thevid.style.display='block'; this.style.display='none'; document.getElementById('video-id<?php echo $i;?>').style.display='none';">
                        <span id="video-icon-id<?php echo $i;?>" class="icon-play"></span>
                        <img id="video-id<?php echo $i;?>" width="150" height="90" alt="" src="<?php echo $item->img; ?>" />
                    </a>
                    <div id="thevideo<?php echo $i;?>" style="display: none;" class="video-container">
                        <iframe id="ytplayer<?php echo $i;?>" type="text/html" src="//www.youtube.com/embed/<?php echo $item->link; ?>?rel=0&amp;autoplay=1&showinfo=0&fs=1" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
                    </div>
                    <h4><a onclick="thevid=document.getElementById('thevideo<?php echo $i;?>'); thevid.style.display='block'; document.getElementById('video-id<?php echo $i;?>').style.display='none'; document.getElementById('video-icon-id<?php echo $i;?>').style.display='none'" title="<?php echo $item->title; ?>"><?php echo $item->title; ?></a></h4>
                </li>
                <?php
                        $i++;
                    }
                } else {
                    echo "Thông tin đang cập nhật.";
                }
                ?>
            </ul>
        </div>
    </section>  
</div>